package com.demo.consumer.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.demo.face.bean.SystemUser;
import com.demo.face.service.TestService;



@Controller
public class TestController {

	Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@Autowired
	TestService testService;
	
	@GetMapping("/index")
	public String index(){
		return "redirect:/index.jsp";
	}
	
	@GetMapping("/getUser")
	@ResponseBody
	public SystemUser getSystemUser(){
		logger.info("TestController:执行查询用户操作");
		SystemUser user = testService.getSystemUser();
		return user;
	}
	
}
